<template>
  <div class="main">
    <el-card>
      <p  v-for="(item,idx) in pdfList" :key="idx" class="text item pdf-item" @click="goLatex(item)">{{ item.name}}</p>
    </el-card>
  </div>
</template>
<script >
  import {PdfList} from '../utils/list'
  export default{
    name:'PdfList',
    data(){
      return {
        pdfList:PdfList
      }
    },
    methods:{
      goLatex(item){
        let arr = item.url.split('/')
        let key = arr[arr.length - 1].split('.pdf')[0]
        this.$router.push({path: '/latex',query:{key:key}})
      }
    }
  }
</script>

<style  scoped>
  .main {
    text-align: center;
    padding: 5px;
    background: white;
    height: 100%;
    overflow-y:scroll;
  }
  .pdf-item{
    cursor:pointer;
  }
</style>
